package net.example.model;

import java.io.File;
import java.io.RandomAccessFile;
import java.io.Serializable;

/**
 * Created by xun on 2015/4/12.
 */
public class FileMessage implements Serializable {
    public String fileName;
    public String filePath;
    public int fileSize;
    public int transferSize;
    public boolean started=false;
    public String projectId;

    public FileMessage(String filePath) {
        try {
            File f=new File(filePath);
            RandomAccessFile file=new RandomAccessFile(f,"rw");
            this.filePath=filePath;
            this.fileName =f.getName();
            this.fileSize=(int)file.length();
        } catch (Exception e) {
            e.printStackTrace();
        }

    }

    public FileMessage(String filePath,String fileName, int fileSize, int transferSize, String projectId){
        this.filePath=filePath;
        this.fileName=fileName;
        this.fileSize=fileSize;
        this.transferSize=transferSize;
        this.projectId=projectId;
    }
}
